<template>
    <div class="user">
      <h2 class="cc">用户名:{{ name }}</h2>
      <h2>年龄:{{ age }}</h2>
      <h2>性别:{{ sex }}</h2>
      <h2>住址:{{ adress }}</h2>
    </div>
  </template>
  
  <script>
  export default {
    name: "User",
    data() {
      return {
        name: "张三",
        age: 18,
        sex: "男",
        adress: "北京",
      };
    },
    methods: {
      show() {
        console.log("show方法被调用了");
      },
    },
  };
  </script>
  
  <!-- scoped表示当前组件的样式 -->
  <style scoped>
  .user {
    background-color: #eee;
    padding: 10px;
  }
  .cc{
    color: blue;
  }
  </style>